﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>TreeGrid 树形表格</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" /><link href="../demo.css" rel="stylesheet" type="text/css" />

    <script src="../../scripts/boot.js" type="text/javascript"></script>
    <style type="text/css">
    .mini-treegrid a
    {
        color:Blue;
    }
    </style>
</head>
<body>
    <h1>TreeGrid 树形表格</h1>
    
<div id="treegrid1" class="mini-treegrid" style="width:700px;height:280px;"     
     url="../data/TreeService.jsp?method=LoadTree" showTreeIcon="true" 
    treeColumn="taskname" idField="id" parentField="pid" resultAsTree="false"  
    allowResize="true"  fitColumns="false" ondrawcell="OnDrawCell"
>
    <div property="columns">
        <div type="indexcolumn"></div>
        <div name="taskname" field="name" width="160" >任务名称</div>
        <div field="id" width="80">ID</div>         
    </div>
</div>
<script type="text/javascript">
    function OnDrawCell(e) {
        if (e.field == "name") {
            var record = e.record;
            var text = record.name || "";
            e.cellHtml = '<a href="a.html?id=' + record.id + '" target="_blank">' + text + '</a>';
        }
    }

</script>

</body>
</html>
